//
//  TFZoomButton.swift
//  TalkfunSDKDemo
//
//  Created by 莫瑞权 on 2022/5/2.
//  Copyright © 2022 Talkfun. All rights reserved.
//

import UIKit

class TFZoomButton: UIButton {

    @objc public let zoom = UIButton()
    override init(frame: CGRect) {
        super.init(frame: frame)
        self.isHighlighted = false
        
       
        self.zoom.isUserInteractionEnabled = false
        self.zoom.contentMode = .scaleAspectFit
        self.zoom.setImage(UIImage.init(named: "HTLive.bundle/bebig"), for: .normal)
        self.zoom.backgroundColor = UIColor(red: 0/255.0, green: 0/255.0, blue: 0/255.0, alpha: 0.8)
       
        self.zoom.layer.cornerRadius = 3;
        
        self.addSubview(zoom)
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    override func layoutSubviews() {
        super.layoutSubviews()
        
        
        let zoomX = self.imageView!.frame.origin.x + self.imageView!.frame.size.width - 45;
        let zoomY = self.imageView!.frame.origin.y + self.imageView!.frame.size.height - 30;
        
           self.zoom.frame = CGRect(x: zoomX, y: zoomY, width: 45, height: 30)

    }
  
    
}
